package com.jack.student;

import java.util.Scanner;

public class StudentInfoSystem {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(true){
            Show.primaryMenu();
            System.out.println("请选择你的操作:");
            int index = scanner.nextInt();
            switch(index){
                case 1: AddInfo.addInfo();break;
                case 2:
                    boolean isTrue = true;
                    while(isTrue){
                    Show.selectMenu();
                    System.out.println("请选择你的操作:");
                    int num1 = scanner.nextInt();
                    switch (num1){
                        case 1:SelectInfo.select();break;
                        case 2:SelectInfo.selectAll();break;
                        case 0:isTrue = false;break;
                        default:
                            System.out.println("你的输入有误，请重新输入:");
                        }
                    }break;
                case 3:
                    boolean isFalse = true;
                    while(isFalse){
                        Show.alterMenu();
                        System.out.println("请选择你的操作:");
                        int num2 = scanner.nextInt();
                        switch (num2){
                            case 1:ChangeInfo.alterName();break;
                            case 2:ChangeInfo.alterAge();break;
                            case 3:ChangeInfo.alterPhoneNum();break;
                            case 4:ChangeInfo.alterClassRoom();break;
                            case 0:isFalse = false;break;
                            default:
                                System.out.println("你的输入有误，请重新输入:");
                        }
                    }break;
                case 4: DelInfo.delInfo();break;
                case 0: System.exit(0);
                default:
                    System.out.println("你的输入有误，请重新输入:");
                    break;
            }
        }
    }
}
